/**
 * 
 */
package cn.nawang.ebeim.client;

import cn.nawang.ebeim.client.bean.UpDownloadFailedBean;
import cn.nawang.ebeim.client.bean.UpDownloadFailedQueue;
import cn.nawang.ebeim.client.util.DbUpDownloadFailedUtil;

/**
 * @ClassName: UpDownloadFailedThread
 * @Description: 上传下载失败的文件处理线程
 * @author zhangjf
 * @date 2015年12月2日 上午8:42:38
 * @version v1.0
 */
public class UpDownloadFailedThread implements Runnable{

  @Override
  public void run() {
    
    while(true){
      try {
        UpDownloadFailedBean bean = UpDownloadFailedQueue.dequeue();
        if(bean.getType()==DbUpDownloadFailedUtil.FAILED_UPLOAD){
          bean.uploadTryAgain();
        }else if(bean.getType()==DbUpDownloadFailedUtil.FAILED_DOWNLOAD){
          bean.downloadTryAgain();
        }
      } catch (InterruptedException e) {
        e.printStackTrace();
      }
    }
    
  }
  
}
